package eventStrategies.physicalModel;

import controller.IController;
import model.IPhysicalDataModel;
import eventManager.AppEvent;
import eventStrategies.IEventResponse;
import events.ECodeEventList;
import events.physicalModel.GetGameEventListEvent;
import events.physicalModel.ReplyGetGameEventListEvent;

public class GetGameEventListStrategy extends IEventResponse {

	private IController controller;
	private IPhysicalDataModel physModel;
	
	public GetGameEventListStrategy(IController controller, IPhysicalDataModel physModel) {
		super(ECodeEventList.GET_GAMEEVENTLIST);		
		this.controller = controller;
		this.physModel = physModel;
	}

	@Override
	public void execute(AppEvent event) {
		GetGameEventListEvent fullEvent = (GetGameEventListEvent) event;
		
		controller.processOutgoingEvent(new ReplyGetGameEventListEvent(fullEvent.sender, physModel.getGameEventList()));
	}

}
